/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2022 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <stdbool.h>
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */
extern bool key_up_pressed;
extern bool key_down_pressed;
extern bool key_left_pressed;
extern bool key_right_pressed;
extern bool emergency_happen;
extern bool north_south_passage;
extern bool east_west_passage;

#define RX_BUFFER_SIZE  100
extern uint8_t rx_buffer[RX_BUFFER_SIZE];
extern uint8_t process_buffer[RX_BUFFER_SIZE];
/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define KeyLeft_Pin GPIO_PIN_2
#define KeyLeft_GPIO_Port GPIOE
#define KeyLeft_EXTI_IRQn EXTI2_IRQn
#define KeyDown_Pin GPIO_PIN_3
#define KeyDown_GPIO_Port GPIOE
#define KeyDown_EXTI_IRQn EXTI3_IRQn
#define KeyRight_Pin GPIO_PIN_4
#define KeyRight_GPIO_Port GPIOE
#define KeyRight_EXTI_IRQn EXTI4_IRQn
#define Buzzer_Pin GPIO_PIN_8
#define Buzzer_GPIO_Port GPIOF
#define LED1_Pin GPIO_PIN_9
#define LED1_GPIO_Port GPIOF
#define LED2_Pin GPIO_PIN_10
#define LED2_GPIO_Port GPIOF
#define KeyUp_Pin GPIO_PIN_0
#define KeyUp_GPIO_Port GPIOA
#define KeyUp_EXTI_IRQn EXTI0_IRQn
#define LCD_BL_Pin GPIO_PIN_15
#define LCD_BL_GPIO_Port GPIOB

/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
